package inet.app.vod.db;

import android.content.Context;

import com.inet.app.framework.database.DatabaseHelper;

public class DBHelper extends DatabaseHelper {

	public DBHelper(Context context) {
		super(context);
	}

	protected static String DB_NAME = "vod.sqlite";

	// create table category
	private static final String SQL_CREATE_CATEGORY = "CREATE TABLE "
			+ DBConfig.TABLE_CATEGORY + " (" + DBConfig.CATEGORY_ID
			+ " TEXT PRIMARY KEY, " + DBConfig.CATEGORY_REMOTE_ID + " TEXT, "
			+ DBConfig.CATEGORY_NAME + " TEXT, " + DBConfig.CATEGORY_GROUP_ID
			+ " TEXT, " + DBConfig.CATEGORY_IS_GROUP + " NUMERIC" + ");";

	// create table video
	private static final String SQL_CREATE_VIDEO = "CREATE TABLE "
			+ DBConfig.TABLE_VIDEO + " (" + DBConfig.VIDEO_ID
			+ " TEXT PRIMARY KEY," + DBConfig.VIDEO_TITLE + " TEXT, "
			+ DBConfig.VIDEO_TITLE_ENG + " TEXT, " + DBConfig.VIDEO_TYPE
			+ " TEXT, " + DBConfig.VIDEO_DESCR + " TEXT, "
			+ DBConfig.VIDEO_IMG_LINK + " TEXT, " + DBConfig.VIDEO_IMDB
			+ " TEXT, " + DBConfig.VIDEO_TIME + " TEXT, "
			+ DBConfig.VIDEO_FB_LINK + " TEXT, " + DBConfig.VIDEO_EP_NUM
			+ " NUMERIC);";

	// create table fun
	private static final String SQL_CREATE_FUN = "CREATE TABLE "
			+ DBConfig.TABLE_FUN + " (" + DBConfig.FUN_ID
			+ " TEXT PRIMARY KEY," + DBConfig.FUN_TITLE + " TEXT, "
			+ DBConfig.FUN_VIEW_NUM + " NUMERIC, " + DBConfig.FUN_FB_LINK
			+ " TEXT, " + DBConfig.FUN_IMG + " TEXT)";

	// create table news
	private static final String SQL_CREATE_NEWS = "CREATE TABLE "
			+ DBConfig.TABLE_NEWS + " (" + DBConfig.NEWS_ID
			+ " TEXT PRIMARY KEY," + DBConfig.NEWS_TITLE + " TEXT, "
			+ DBConfig.NEWS_CONTENT + " TEXT, " + DBConfig.NEWS_FB_LINK
			+ " TEXT, " + DBConfig.NEWS_IMG + " TEXT)";

	@Override
	protected void createQueriesTable() {
		addQuery(SQL_CREATE_CATEGORY);
		addQuery(SQL_CREATE_VIDEO);
		addQuery(SQL_CREATE_FUN);
		addQuery(SQL_CREATE_NEWS);
	}
}
